import os

from google.appengine.ext import webapp
import google.appengine.ext.webapp
from google.appengine.ext.webapp import template
from UsersEntity import User
 

class UserPage(webapp.RequestHandler):
    def get(self):
        #print self.request.path
        
        if self.request.path == '/':
            self.response.out.write(template.render('templates/index.html', {}))
        if self.request.path == '/index.html':
            self.response.out.write(template.render('templates/index.html', {}))
            #self.redirect(index.html, True)
        if self.request.path == '/adduser':
            user = User(name=self.request.get('name'))
            user.put()    
            self.response.out.write(template.render('templates/index.html', {}))
        if self.request.path == '/usersadd.html':
            self.response.out.write(template.render('templates/usersadd.html', {}))
        if self.request.path == '/userslist.html':
            user_list = User.all()
            self.response.out.write(template.render('templates/userslist.html', {'users':user_list}))
            
            